<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<%@ include file="/WEB-INF/views/include/easyui.jsp"%>

</head>
<body>
<div>
	<form id="mainform" action="${ctx}/product/productType/${action}" method="post">
	<table  class="formTable" align="center">
		<tr>
			<td width="18%" align="right">类型名称：</td>
			<td width="20%" align="left">
			<input type="hidden" name="id" value="${id }" />
			<input name="typename" type="text" value="${productType.typename }" class="easyui-validatebox"  data-options="required:true,validType:['length[0,255]']" />
			</td>
		</tr>
		<tr>
			<td width="18%" align="right">类型编码：</td>
			<td width="20%" align="left"><input name="typecode" type="text" value="${productType.typecode }" class="easyui-validatebox" data-options="required:true,validType:['length[0,11]']"/></td>
		</tr>
<!-- 		<tr>
			<td width="18%" align="right">是否可用：</td>
			<td width="20%" align="left"><input name="useable" type="text" value="${productType.useable}" class="easyui-validatebox" data-options="required:true"/>(0-是 1-否)</td>
		</tr>
-->
		<td width="18%" align="right">是否可用：</td>
		<td>
				<!-- <input type="radio" id="able" name="useable" value="0"/><label for="able">是</label>
				<input type="radio" id="disable" name="useable" value="1"/><label for="disable">否</label> -->
				<input type="radio" id="able" name="useable" value="0" ${productType.useable=='0'?'checked':''}/><label for="able">是</label>
				<input type="radio" id="disable" name="useable" value="1" ${productType.useable=='0'?'':'checked'}/><label for="disable">否</label>
		</td>
		<tr>		
			<td width="18%" align="right">序号：</td>
			<td width="20%" align="left"><input name="ordernum" type="text" value="${productType.ordernum}" class="easyui-validatebox" data-options="required:false"/></td>
		</tr>
	</table>
	</form>
</div>

<script type="text/javascript">
$(function(){
	
	//上级菜单
	$('#pid').combotree({
		width:180,
		method:'GET',
	    url: '${ctx}/product/productType/json',
	    idField : 'id',
	    textFiled : 'name',
		parentField : 'pid',
	    animate:true
	});  
	
	$('#mainform').form({    
	    onSubmit: function(){    
	    	var isValid = $(this).form('validate');
			return isValid;	// 返回false终止表单提交
	    },    
	    success:function(data){   
	    	if(successTip(data,dg,d))
	    		dg.treegrid('reload');
	    }    
	}); 
});

</script>

</body>
</html>